<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditCommandeTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditCommandeLabel_id}" for="id" />
                    <h:inputText id="id" value="#{CommandeBean.selected.id}" title="#{bundle.EditCommandeTitle_id}" required="true" requiredMessage="#{bundle.EditCommandeRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_etat}" for="etat" />
                    <h:inputText id="etat" value="#{CommandeBean.selected.etat}" title="#{bundle.EditCommandeTitle_etat}" required="true" requiredMessage="#{bundle.EditCommandeRequiredMessage_etat}"/>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_dateCommande}" for="dateCommande" />
                    <h:inputText id="dateCommande" value="#{CommandeBean.selected.dateCommande}" title="#{bundle.EditCommandeTitle_dateCommande}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_dateLivraison}" for="dateLivraison" />
                    <h:inputText id="dateLivraison" value="#{CommandeBean.selected.dateLivraison}" title="#{bundle.EditCommandeTitle_dateLivraison}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_prixTotalLivraison}" for="prixTotalLivraison" />
                    <h:inputText id="prixTotalLivraison" value="#{CommandeBean.selected.prixTotalLivraison}" title="#{bundle.EditCommandeTitle_prixTotalLivraison}" required="true" requiredMessage="#{bundle.EditCommandeRequiredMessage_prixTotalLivraison}"/>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_modePayement}" for="modePayement" />
                    <h:inputText id="modePayement" value="#{CommandeBean.selected.modePayement}" title="#{bundle.EditCommandeTitle_modePayement}" required="true" requiredMessage="#{bundle.EditCommandeRequiredMessage_modePayement}"/>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_montant}" for="montant" />
                    <h:inputText id="montant" value="#{CommandeBean.selected.montant}" title="#{bundle.EditCommandeTitle_montant}" required="true" requiredMessage="#{bundle.EditCommandeRequiredMessage_montant}"/>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_adresseFacturation}" for="adresseFacturation" />
                    <h:selectOneMenu id="adresseFacturation" value="#{CommandeBean.selected.adresseFacturation}" title="#{bundle.EditCommandeTitle_adresseFacturation}" >
                        <f:selectItems value="#{adresseController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_adresseLivraison}" for="adresseLivraison" />
                    <h:selectOneMenu id="adresseLivraison" value="#{CommandeBean.selected.adresseLivraison}" title="#{bundle.EditCommandeTitle_adresseLivraison}" >
                        <f:selectItems value="#{adresseController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditCommandeLabel_client}" for="client" />
                    <h:selectOneMenu id="client" value="#{CommandeBean.selected.client}" title="#{bundle.EditCommandeTitle_client}" >
                        <f:selectItems value="#{clientController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{CommandeBean.update}" value="#{bundle.EditCommandeSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditCommandeViewLink}"/>
                <br />
                <h:commandLink action="#{CommandeBean.prepareList}" value="#{bundle.EditCommandeShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditCommandeIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
